<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix='fmt' uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    response.setHeader("X-Frame-Options", "SAMEORIGIN");
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    String userId = new String(request.getParameter("userId").getBytes("ISO-8859-1"), "utf-8");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>企业基本信息</title>
    <jsp:include page="../../public/public.jsp"/>
<body>

<div style="margin:10px 0 10px 0;"></div>
<div class="easyui-tabs" style="width:1600px;height:650px">
    <div title="企业基本信息" style="padding:10px">
        <table id="table-3">

            <tr height="40px;">
                <td style="text-align:right" align="right">企业名称：</td>

                <td>
                    <input  class="easyui-textbox" id="name"/>
                </td>

                <td></td>

                <td style="text-align:right" align="right">营业执照注册号：</td>


                <td>
                    <input  class="easyui-textbox" id="license"/>
                </td>
            </tr>

            <tr>
                <td style="text-align:right" align="right">注册资金：</td>

                <td>
                    <input  class="easyui-textbox" id="zhuceZijin"/>
                </td>

                <td></td>
                <td style="text-align:right" align="right">公司电话：</td>

                <td>
                    <input  class="easyui-textbox" id="companyPhone"/>
                </td>
            </tr>

            <tr>
                <td style="text-align:right" align="right">企业法人：</td>
                <td>
                    <input  class="easyui-textbox" id="legalPerson"/>
                </td>
                <td></td>
                <td style="text-align:right">法人手机：</td>
                <td>
                    <input  class="easyui-textbox" id="legalTel"/>
                </td>
            </tr>


            <tr>
                <td style="text-align:right">所属地区：</td>
                <td>
                    <div id="city_1">
                        <select class="prov" name="province"></select>
                        <select class="city" disabled="disabled" name="city"></select>
                        <select class="dist" disabled="disabled" name="area"></select>

                        <input type="hidden" id="province" class="easyui-textbox""/>
                        <input type="hidden" id="city" class="easyui-textbox""/>
                        <input type="hidden" id="area" class="easyui-textbox""/>
                    </div>
                </td>
                <td></td>
                <td style="text-align:right">公司地址：</td>
                <td>
                    <input  class="easyui-textbox" id="address"/>
                </td>
            </tr>

            <tr>
                <td style="text-align:right">联络员姓名：</td>
                <td>
                    <input  class="easyui-textbox" id="contactName"/>
                </td>
                <td></td>
                <td style="text-align:right">联络员手机：</td>
                <td>
                    <input  class="easyui-textbox" id="contactTel"/>
                </td>
            </tr>

            <tr>
                <td style="text-align:right">总经理：</td>
                <td>
                    <input  class="easyui-textbox" id="manager"/>
                </td>
                <td></td>
                <td style="text-align:right">总经理联系方式：</td>
                <td>
                    <input  class="easyui-textbox" id="managerTel"/>
                </td>
            </tr>

            <tr>
                <td style="text-align:right">单位类型：</td>
                <td>
                    <input id="companyClassify" class="easyui-textbox">

                </td>
                <td></td>
            </tr>

            <tr>
                <td style="text-align:right; padding-top: 30px; "><h3>企业员工情况：</h3></td>
            </tr>

            <tr>
                <td style="text-align:right">博士：</td>
                <td>
                    <input  class="easyui-textbox" id="doctorCount"/>
                </td>
                <td></td>
                <td style="text-align:right">硕士：</td>
                <td>
                    <input  class="easyui-textbox" id="masterCount"/>
                </td>
            </tr>

            <tr>
                <td style="text-align:right">大学本科：</td>
                <td>
                    <input  class="easyui-textbox" id="bachelorCount"/>
                </td>
                <td></td>
                <td style="text-align:right">大专：</td>
                <td>
                    <input  class="easyui-textbox" id="dazhuanCount"/>
                </td>
            </tr>

            <tr>
                <td style="text-align:right">中专及高中：</td>
                <td>
                    <input  class="easyui-textbox" id="zhongzhuanCount"/>
                </td>

            </tr>

            <tr>
                <td style="text-align:right;padding-top: 30px; "><h3>技术人员情况：</h3></td>
            </tr>

            <tr>
                <td style="text-align:right">助工：</td>
                <td>
                    <input  class="easyui-textbox" id="zhugongCount"/>
                </td>
                <td></td>
                <td style="text-align:right">工程师：</td>
                <td>
                    <input  class="easyui-textbox" id="gongchengshiCount"/>
                </td>
            </tr>

            <tr>
                <td style="text-align:right">高工：</td>
                <td>
                    <input  class="easyui-textbox" id="gaogongCount"/>
                </td>

            </tr>


            <tr>
                <td style="text-align:right;padding-top: 30px;"><h3>企业实力：</h3></td>
            </tr>

            <tr>
                <td style="text-align:right">发明创造：</td>
                <td>
                    <input  class="easyui-textbox" id="famingCount"/>
                </td>
                <td></td>
                <td style="text-align:right">著作权：</td>
                <td>
                    <input  class="easyui-textbox" id="zhuzuoquanCount"/>
                </td>
            </tr>

            <tr>
                <td style="text-align:right">经营范围：</td>
                <td colspan="4">
                    <input  class="easyui-textbox" id="jingyingFanwei"/>
                </td>
            </tr>

            <tr>
                <td style="text-align:right">单位简介：</td>
                <td colspan="4">
                    <textarea  class="easyui-textbox" id="companyJieshao"/></textarea>
                </td>
            </tr>
        </table>

    </div>


</div>

<script>

    $(function () {
        var userId = '<%=userId %>';
        $.ajax({
            url:'<%=basePath %>companyMange/baseInfoByUserId',
            type:'post',
            data: {
                "userId": userId
            },
            dataType: 'json',
            error: function () {
                $.messager.alert("提示", "查询异常", "error");
            },
            success: function (map) {
                var data = map.entity;
                var name = data.name;
                var license = data.license;
                var zhuceZijin = data.zhuceZijin;
                var companyPhone = data.companyPhone;
                $("#name").textbox("setValue", name);
                $("#license").textbox("setValue", license);
                $("#zhuceZijin").textbox("setValue", zhuceZijin);
                $("#companyPhone").textbox("setValue", companyPhone);
            }
        });
    });


    /* 点击 保存时触发 */
    function add() {
        $.ajax({
            url: '<%=basePath %>companyBase/insertBaseInfo',
            type: 'post',
            data: $("#addForm").serialize(),
            dataType: 'json',
            error: function () {
                $.messager.alert("友情提示", "系统异常,请稍后尝试", "error");
            },
            success: function (data) {
                var row = data.row;
                var msg = data.msg;
                var companyBaseId = data.companyBaseId;
                $("#companyBaseId").val(companyBaseId);
                $("#companyId").val(companyBaseId);
                $.messager.alert("友情提示", msg, "info");

            }
        });
    }


    /* 点击 保存时触发 */
    function add_zizhi() {
        $.ajax({
            url: '<%=basePath %>companyBase/insertLevelInfo',
            type: 'post',
            data: $("#addForm_zizhi").serialize(),
            dataType: 'json',
            error: function () {
                $.messager.alert("友情提示", "系统异常,请稍后尝试", "error");
            },
            success: function (data) {
                var row = data.row;
                var msg = data.msg;
                var companyLevelInfoId = data.companyLevelInfoId;
                $("#companyLevelInfoId").val(companyLevelInfoId);
                $.messager.alert("友情提示", msg, "info");

            }
        });
    }

</script>
</body>
</html>